package com.itheima.stock.utils;

import com.alibaba.fastjson.JSON;
import com.itheima.stock.common.constance.JsonConstance;
import com.itheima.stock.mapper.StockBlockRtInfoMapper;
import com.itheima.stock.pojo.StockBlockRtInfo;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ParserStockInfoUtil {

    public  List<StockBlockRtInfo> parse4StockBlock(String result) {
        //System.out.println(result);
        //StockBlockRtInfo stockBlockRtInfo = new StockBlockRtInfo();
        String bkjson = result.split("=")[1];
        Map<String,String> resultMap = new HashMap();
        resultMap= JSON.parseObject(bkjson, Map.class);
        for (Map.Entry<String, String> entry : resultMap.entrySet()) {
            String value = entry.getValue();
            String key = entry.getKey();
            String[] split = value.split(",");
         System.out.println(key+"："+split.length+"个:"+split);

            System.out.println("插入成功");
        }

        return null;
    }
}
